package at.donalfonso.model;

import java.util.Iterator;

import at.donalfonso.model.Pizza.PizzaEnum;

public class LieferKunde extends Gruppe {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4959913463072248974L;

	private String id;
	private String adresse;
	private Boolean adresseExistiert;
	
	private LieferKundeStatus lieferStatus;
	
	public LieferKunde(int filialID, String adresse, Boolean addressExists, PizzaEnum pizza1, PizzaEnum pizza2, PizzaEnum pizza3,
			PizzaEnum pizza4) {
		super(filialID, pizza1, pizza2, pizza3, pizza4);
		this.adresse = adresse;
		this.adresseExistiert = addressExists;
		id = "L" + numId;
		status = GruppeStatus.BESTELLT;
		lieferStatus = LieferKundeStatus.NEU;
	}
	
	public String getAdresse() {
		return adresse;
	}
	
	public Boolean adresseExistiert() {
		return adresseExistiert;
	}
	
	@Override
	public String toString() {
		
		StringBuffer buffer = new StringBuffer();
		
		buffer.append("Lieferkunde " + id + " (" + filialID +"): " + lieferStatus + ": ");
		buffer.append(" Adresse: " + adresse + " ("+adresseExistiert()+") : "); 
		
		for (Iterator<Pizza.PizzaEnum> i = pizzen.iterator(); i.hasNext();){
			buffer.append(i.next() + " ");
		}
				
		return buffer.toString();
	}

	public void setStatus(LieferKundeStatus status) {
		this.lieferStatus = status; 
	}
	
}
